package com.controller;

import java.util.List;

import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
import org.springframework.web.servlet.ModelAndView;

import com.controller.account.ListAccount;

public class TestListAccount extends AbstractDependencyInjectionSpringContextTests {
	// @Override
	// protected String[] getConfigLocations() {
	// return new String[] {
	// "file:D:/WORKSPACE/MyEclipse/springmock/WebRoot/WEB-INF/mvc-config.xml"
	// };
	// }
	//
	// @SuppressWarnings("static-access")
	// public void testListCourse() throws Exception {
	// ListAccount la = (ListAccount)
	// this.applicationContext.getBean("listCourse");
	//
	// MockHttpServletRequest request = new MockHttpServletRequest();
	// MockHttpServletResponse response = new MockHttpServletResponse();
	//
	// request.setMethod("POST");
	//
	// request.addParameter("userid", "aa");
	// request.addParameter("userpwd", "bb");
	//
	// ModelAndView mav = lc.handleRequest(request, response);
	//
	// assertEquals("courseList", mav.getViewName());
	// assertNotNull(mav.getModelMap().get("courses"));
	// List<Course> list = (List<Course>) mav.getModelMap().get("courses");
	// for (Course c : list) {
	// System.out.println(c.getId());
	// System.out.println(c.getName());
	// }
	//
	// }
}
